const path = require('path')
const merge = require('webpack-merge')
const common = require('./webpack.common')

module.exports = merge(common, {
    mode: 'development',
    devtool: 'source-map',
    module: {
        rules: [
            {
                test: /\.less$/,
                use: [
                    'style-loader',
                    'css-loader',
                    'postcss-loader',
                    'less-loader',
                ]
            },
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader',
                    'postcss-loader',
                ]
            },
        ]
    },
    devServer: {
        hot: true,
        contentBase: './public',
        quiet: true,
        clientLogLevel: 'error',
        overlay: true,
    },
    output: {
        path: path.join(__dirname, 'dist'),
        filename: '[name].js'
    },
    optimization: {
        noEmitOnErrors: false,
    }
})

